m = Map("socatg")
m.title = translate("IPv6 端口转发")
m.description = translate('<a href=\"https://github.com/big-tooth/luci-app-socatg\" target=\"_blank\"> GitHub 项目地址 </a>')

s = m:section(TypedSection, "forward")
s.title = translate("端口转发规则")
s.addremove = true
s.anonymous = true
s.template = "cbi/tblsection"

v6port = s:option(Value, "v6port", translate("IPv6端口"))
v6port.datatype = "port"
v6port.optional = false

v4host = s:option(Value, "v4host", translate("IPv4主机"))
v4host.datatype = "host"
v4host.optional = false

v4port = s:option(Value, "v4port", translate("IPv4端口"))
v4port.datatype = "port"
v4port.optional = false

local apply = luci.http.formvalue("cbi.apply")
if apply then
	io.popen("/etc/init.d/socatg restart")
end

return m